﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CarLoanSystem.Entity;
using CarLoanSystem.DAL;

namespace CarLoanSystemWeb.Page.AlertMessage
{
    public partial class wuc_view_alerts : System.Web.UI.UserControl
    {
        private static AlertsMessageItem alertMessage;
        private static AppointmentsItem appointment;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                alertMessage = AlertsMessageInfoDAL.LoadAlertsMessage(Convert.ToInt32(this.Request.QueryString["id"].ToString()));
                this.txtMessage.Text = alertMessage.ALERTS_MESSAGE_DETAIL;
                alertMessage.ALERTS_MESSAGE_STATUS = "I";
                AlertsMessageInfoDAL.Update(alertMessage);
                appointment = new AppointmentsItem();
                appointment.LOAN_ID = alertMessage.LOAN_ID;
                appointment.APPOINTMENTS_STATUS = "I";
                AppointmentsInfoDAL.Update(appointment);
            }
        }
    }
}